<div ng-controller="ItemCtrl" ng-init="downloaditemsAction()">
    <ul class="sui-breadcrumb">
        <li>
            <a href="#/item/list">{{ "Item" | translate }}</a>
        </li>
        <li class="active">
            {{ "List" | translate }}
        </li>
        <span class="sui-form sui-form pull-right">
            <!-- 条码:<input type="text" placeholder="{{ 'sku条码' | translate }}" ng-model="barcode" /> -->
            <!-- 编码:<input type="text" placeholder="{{ 'sku编码' | translate }}" ng-model="sku_outer_id" /> -->
            <input type="text" placeholder="{{ 'keyword' | translate }}" ng-model="keyword" />
            <button class="sui-btn btn-primary" type="submit" ng-click="getdownloaditems(1)">
                {{ "search" | translate }}
            </button>
        </span>
        </span>
    </ul>
    <div ng-show="is_main==1">
        <downloaditems-main-tab ng-model="type" click-tab="getdownloaditems(1)"></downloaditems-tab>
    </div>
    <div ng-show="is_main==2">
        <downloaditems-sub-tab ng-model="type" click-tab="getdownloaditems(1)"></downloaditems-tab>
    </div>

    <div>
        <table class="sui-table table-bordered">
            <thead>
                <tr>
                    <th>#</th>
                    <th nowrap>{{ "item_image" | translate }}</th>
                    <th nowrap>{{ "item_id" | translate }}</th>
                    <th nowrap>{{ "title" | translate }}</th>
                    <th nowrap>{{ "价格" | translate }}</th>
                    <th nowrap>{{ "状态" | translate }}</th>
                </tr>
            </thead>
            <tbody>
                <tr ng-repeat="list in itemslist">
                    <td>
                        <input type="checkbox" name="sjmodel" checklist-model="$parent.sjmodel" checklist-value="list" />
                    </td>
                    <td style="width:120px;"><img ng-src="{{ list.img }}" /></td>
                    <td>
                        {{ list.item_id }}
                        <br /> {{ list.created_at | ddtt }}
                    </td>
                    <td>{{ list.title }}</td>
                    <td>{{ list.price }}</td>
                    <td>
                        <span class="sui-label label-warning" ng-if="list.on_shelves==1">销售中</span>
                        <span class="sui-label label-danger" ng-if="list.on_shelves!=1">已下架</span>
                    </td>
                </tr>
            </tbody>
        </table>
        <!-- 分页start -->
        <pager page-no="{{ pageNo }}" page-size="pageSize" total="itemsTotal" get-data="getdownloaditems(pageNo)"></pager>
        <!-- 分页end -->
        <span ng-show="itemslist.length">
            <button ng-click="checkAll()" class="sui-btn btn-success">
              全选
            </button>
            <button ng-click="nocheckAll()" class="sui-btn btn-success">
              反选
            </button>
            <span ng-show="sjmodel.length">
                <span ng-show="type==1">
                    <div ng-show="is_main!=1" class="sui-msg msg-warning">
                        <div class="msg-con">
                            下载后的价格改为：底价 x <input type="text" smart-float ng-model="price_percent"> %（最低100%）
                        </div>
                        <s class="msg-icon"></s>
                    </div>
                    
                    <button ng-show="price_percent>=100" type="button" class="sui-btn btn-warning" ng-click="savedownloaditems(1)">
                    {{ "绑定商品" | translate }}
                    </button>
                </span>
        <span ng-show="type ==2">
                    <button type="button" class="sui-btn btn-danger" ng-click="savedownloaditems(2)">
                        {{ "解除绑定" | translate }}
                    </button>
                </span>
        </span>
        </span>
    </div>

</div>